package com.david.learning.algorithm;

/**
 * We try to figure out finding how much solutions for one certain number
 * ladder.
 * 
 * @author David Qi
 * 
 */
public class LadderSolution {
	private static final int[] STEPS = new int[] {2,3,4};
	
	
	public static void main(String[] args) {
		System.out.println(climbLadder(6));
	}
	
	public static int climbLadder(int totalSteps) {
		
		int sum = 0;
		if(totalSteps ==0) { return 1;}
		if(totalSteps < 0) { return 0;}
		for(int i : STEPS) {
			sum += climbLadder(totalSteps - i);
		}
		return sum;
	}
}
